﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucMenu.ascx.cs" Inherits="Publish_ucMenu" %>

<script type="text/javascript" language="javascript">
var submenutime = 0;
function changeSubMenu(id, length, clear) {
    for (i=0; i<length; i++) {
        if (document.getElementById('menu_' + i) != null) {
            document.getElementById('menu_' + i).className = 'tab_normal';
        }
    }
    if (document.getElementById('menu_' + id) != null) {
        document.getElementById('menu_' + id).className = 'tab_select';
    }
    if (document.getElementById('sub_menu_' + id) != null && document.getElementById('sub_menu') != null) {
        var html = document.getElementById('sub_menu_' + id).innerHTML;
        document.getElementById('sub_menu').innerHTML = html;
    } else {
        document.getElementById('sub_menu').innerHTML = "";
    }
    if (clear==1) {
        clearInterval(submenutime);
    }
}
function clearSubMenu(id, length) {
    submenutime = setInterval(function() {changeSubMenu(id, length, 1)}, 8000); 
}
</script>

<asp:Repeater ID="rptProductMenu" runat="server" EnableViewState="false">
    <HeaderTemplate>
        <ul id="productmenu">
    </HeaderTemplate>
    <ItemTemplate>
        <li id="menu_<%# Eval("PathIndex")%>" class="tab_normal" onclick="changeSubMenu(<%# Eval("PathIndex")%>,<%=m_Count%>)"
            onmouseover="changeSubMenu(<%# Eval("PathIndex")%>,<%=m_Count%>, 1)" onmouseout="clearSubMenu(-1,<%=m_Count%>)">
            <a href="Product.aspx?id=<%# Eval("IDCategory")%>">
                <%# Eval("Title")%></a></li></ItemTemplate>
    <FooterTemplate>
        </ul></FooterTemplate>
</asp:Repeater>
<%=ReadSubMenu()%>
